package com.itheima.health.dao;

import com.github.pagehelper.Page;
import com.itheima.health.pojo.Menu;
import com.itheima.health.pojo.Permission;
import com.itheima.health.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ：lizimo
 * @date ：Created in 2020/1/2
 * @description ：
 * @version: 1.0
 */
public interface UserRoleDao {

    void insert(Role role);

    Page<Role> selectByCondition(@Param("queryString") String queryString);


    Role selectById(@Param("id") Integer id);

    void insertRoleAndMenuId(@Param("id") Integer id, @Param("menuId") Integer menuId);

    void insertRoleAndPermissionId(@Param("id") Integer id, @Param("permissionId") Integer permissionId);

    List<Menu> selectAllMenu();

    List<Menu> selectMenuByRole(@Param("id") Integer id);

    void update(Role role);

    void deleteRoleAndPermissionByRoleIds(@Param("id") Integer id);


    void deleteRoleAndMenuByRoleIds(@Param("id") Integer id);

    List<Permission> selectPermissionByRole(@Param("id") Integer id);

    List<Menu> selectMenuByRoleId(@Param("id") Integer id);

    List<Permission> selectPermissionIdByRoleId(@Param("id") Integer id);

    Long countMenuIdByRoleId(@Param("id") Integer id);

    Long countPermissionIdByRoleId(@Param("id") Integer id);

    void delete(@Param("id") Integer id);
}

